package provider;

import framework.Protocol;
import framework.ProtocolFactory;
import framework.URL;
import provider.api.HelloService;
import provider.impl.HelloServiceImpl;
import register.RemoteMapRegister;

public class Provider {

    public static void main(String[] args) {
        //1本地注册
        LocalRegister.regist(HelloService.class.getName(), HelloServiceImpl.class);
        //2远程注册
        URL url=new URL("localhost",8081);
        RemoteMapRegister.register(HelloService.class.getName(),url);
        //启动tomcat
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);
    }
}
